//
//  ColorPickerDemo.swift
//  SwiftUIDemo
//
//  Created by Tilt Wang on 2025/7/1.
//

import SwiftUI

struct ColorPickerDemo: View {
    
    @State var backgroundColor: Color = .white
    
    var body: some View {
        ZStack {
            backgroundColor
                .edgesIgnoringSafeArea(.all)
            
            ColorPicker("Select a color", selection: $backgroundColor, supportsOpacity: true)
                .padding()
                .background(.black)
                .cornerRadius(10)
                .foregroundColor(.white)
                .font(.headline)
                .padding(50)
        }
        .padding()
        
    }
}

#Preview {
    ColorPickerDemo()
}
